libelf: make elf_phdr_is_loadable load read-only segments.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 29 Jan 2010 07:14:32 +0000 (07:14 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 29 Jan 2010 07:14:32 +0000 (07:14 +0000)
From: Brad Plant <bplant@iinet.net.au>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/libelf/libelf-tools.c

index 99a0a9157607735b7b15dd6124e653cd16c759d4..e18f02d6dbcbca4fe4ecc06c167268f43a8401da 100644 (file)
@@ -235,7 +235,7 @@ int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr)
     uint64_t p_type = elf_uval(elf, phdr, p_type);
     uint64_t p_flags = elf_uval(elf, phdr, p_flags);
 
-    return ((p_type == PT_LOAD) && (p_flags & (PF_W | PF_X)) != 0);
+    return ((p_type == PT_LOAD) && (p_flags & (PF_R | PF_W | PF_X)) != 0);
 }
 
 /*